package cn.chinaflame.pagodas.entity;
import javax.persistence.*;
/**
 * Created by yw on 2018/1/15.
 */
@Entity
@Table(name = "yw_session", schema = "pagoda", catalog = "")
public class YwSession {
    private String id;
    private String sessionid;
    private String projectId;
    private String userid;
    private long createTimestamp;
    private long updateTimestamp;
    private long period;
    private String object;
    private String ip;
    private String createtime;
    private String updatetime;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "update_timestamp")
    public long getUpdateTimestamp() {
        return updateTimestamp;
    }

    public void setUpdateTimestamp(long updateTimestamp) {
        this.updateTimestamp = updateTimestamp;
    }

    @Basic
    @Column(name = "object")
    public String getObject() {
        return object;
    }

    public void setObject(String object) {
        this.object = object;
    }

    @Basic
    @Column(name = "ip")
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "sessionid")
    public String getSessionid() {
        return sessionid;
    }

    public void setSessionid(String sessionid) {
        this.sessionid = sessionid;
    }

    @Basic
    @Column(name = "project_id")
    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    @Basic
    @Column(name = "userid")
    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    @Basic
    @Column(name = "create_timestamp")
    public long getCreateTimestamp() {
        return createTimestamp;
    }

    public void setCreateTimestamp(long createTimestamp) {
        this.createTimestamp = createTimestamp;
    }

    @Basic
    @Column(name = "period")
    public long getPeriod() {
        return period;
    }

    public void setPeriod(long period) {
        this.period = period;
    }

    @Basic
    @Column(name = "createtime")
    public String getCreatetime() {
        return createtime;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    @Basic
    @Column(name = "updatetime")
    public String getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(String updatetime) {
        this.updatetime = updatetime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        YwSession ywSession = (YwSession) o;

        if (createTimestamp != ywSession.createTimestamp) return false;
        if (period != ywSession.period) return false;
        if (id != null ? !id.equals(ywSession.id) : ywSession.id != null) return false;
        if (sessionid != null ? !sessionid.equals(ywSession.sessionid) : ywSession.sessionid != null) return false;
        if (projectId != null ? !projectId.equals(ywSession.projectId) : ywSession.projectId != null) return false;
        if (userid != null ? !userid.equals(ywSession.userid) : ywSession.userid != null) return false;
        if (createtime != null ? !createtime.equals(ywSession.createtime) : ywSession.createtime != null) return false;
        if (updatetime != null ? !updatetime.equals(ywSession.updatetime) : ywSession.updatetime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (sessionid != null ? sessionid.hashCode() : 0);
        result = 31 * result + (projectId != null ? projectId.hashCode() : 0);
        result = 31 * result + (userid != null ? userid.hashCode() : 0);
        result = 31 * result + (int) (createTimestamp ^ (createTimestamp >>> 32));
        result = 31 * result + (int) (period ^ (period >>> 32));
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (updatetime != null ? updatetime.hashCode() : 0);
        return result;
    }
}
